package com.lepu.app.fun.my.bean;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class BeanFensi {

	public static final int STATUS_1 = 1;//1-单边关注
	public static final int STATUS_2 = 2;//互相关注
	
	public static final int STATUS_3 = 3;//添加关注
	
	public String UserID;
	public String Avatar;
	public String NickName;
	public int FollowStatus;
	
	
	public static ArrayList<BeanFensi> parseJsonData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONArray jsonArray = obj1.getJSONArray("ListInfo");
			
			result = jsonArray.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		ArrayList<BeanFensi> testArraylist = gson.fromJson(result,
				new TypeToken<List<BeanFensi>>() {
				}.getType());
		return testArraylist;
		
		//return getTestData();
	}
	
	public static ArrayList<BeanFensi> getTestData2()
	{
		ArrayList<BeanFensi> testArraylist = new ArrayList<BeanFensi>();
		
		for(int i=0;i<10;i++)
		{
			BeanFensi item = new BeanFensi();
			item.Avatar = "";
			item.NickName = "Title";
			item.UserID = "0";
			item.FollowStatus = STATUS_1;
			testArraylist.add(item);
		}
		
		for(int i=0;i<10;i++)
		{
			BeanFensi item = new BeanFensi();
			item.Avatar = "";
			item.NickName = "Title";
			item.UserID = "0";
			item.FollowStatus = STATUS_2;
			testArraylist.add(item);
		}
		
		return testArraylist;
	}
}
